
public class ReverseWordOfString {
	
	public static void main(String args[])
	   {
	      String original="Sample String used to test with simple solution";
	      String reverse = "";

	      reverse= reverseWords(original);
	      System.out.println("Original String\n" + original);
	      System.out.println("Reverse String\n" + reverse);
	   }
	
	public static String reverseWords(String sentence) {
	    String[] words = sentence.split(" ");
	    String tmp="";
	    for (int i = words.length - 1; i >= 0; i--) {
	        tmp=tmp+words[i]+" ";
	    }
	    return tmp;
	}

}
/*
Original String
Sample String used to test with simple solution
Reverse String
solution simple with test to used String Sample 
*/